<!DOCTYPE html>
<%@ page language="java" import="java.util.*" contentType="text/html; charset=utf-8" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%
    String path = request.getContextPath();
    String basePath = request.getScheme() + "://"
            + request.getServerName() + ":" + request.getServerPort()
            + path;

%>
<html lang="en">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags -->
    <meta name="description" content="">
    <meta name="author" content="">
    <link rel="icon" href="IMG/favicon.ico">


    <title>录入销售记录</title>

    <!-- Bootstrap core CSS -->
    <link href="static/css/dist/css/bootstrap.min.css?v=1" rel="stylesheet">
    <!-- Bootstrap theme -->
    <link href="static/css/dist/css/bootstrap-theme.min.css" rel="stylesheet">
    <!-- IE10 viewport hack for Surface/desktop Windows 8 bug -->
    <link href="static/css/assets/css/ie10-viewport-bug-workaround.css" rel="stylesheet">

    <!-- Custom styles for this template -->
    <link href="static/css/theme.css" rel="stylesheet">
    <script src="static/js/echarts.min.js"></script>
    <!-- Just for debugging purposes. Don't actually copy these 2 lines! -->
    <!--[if lt IE 9]>
    <script src="static/css/assets/js/ie8-responsive-file-warning.js"></script><![endif]-->
    <script src="static/css/assets/js/ie-emulation-modes-warning.js"></script>

    <!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
    <!--[if lt IE 9]>

    <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
    <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>

    <![endif]-->
</head>

<body role="document">

<!-- Fixed navbar -->
<nav class="navbar navbar-inverse navbar-fixed-top">
    <div class="container">
        <div class="navbar-header">
            <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar"
                    aria-expanded="false" aria-controls="navbar">
                <span class="sr-only">Toggle navigation</span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
            </button>
            <a class="navbar-brand" href="main">IBONUS</a>
        </div>
        <div id="navbar" class="navbar-collapse collapse">
            <ul class="nav navbar-nav">
                <!--<li class="active"><a href="#"></a></li>-->
                <li class="active"><a href="<%= basePath %>/saleIntoPage"><span style="font-family:微软雅黑; ">录入销售记录</span></a>
                </li>
                <li><a href="<%= basePath %>/bonusDYIntoPage"><span style="font-family:微软雅黑; ">销售统计</span></a></li>
                <li class="dropdown">
                    <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true"
                       aria-expanded="false">${userInfo.userRealname} <span class="caret"></span></a>
                    <ul class="dropdown-menu">
                        <li><a href="logout"><span style="font-family:微软雅黑; ">注销</span></a></li>
                        <li><a href="updatePasswordPage"><span style="font-family:微软雅黑; ">修改密码</span></a></li>
                    </ul>
                </li>
            </ul>
        </div>
        <!--/.nav-collapse -->
    </div>
</nav>


<div class="container">

    <!-- Main jumbotron for a primary marketing message or call to action -->
    <div class="panel panel-default">
        <!-- Default panel contents -->
        <div class="panel-heading">
      <span style="font-family:微软雅黑;">
      销售产品信息页面
        <button type="button" id="loadButton" name="loadButton" data-toggle="modal" data-target="#addModal"
                onClick="loadAddModel()" class="btn btn-default glyphicon glyphicon-plus">

        </button>
         <span style="color:red">${msg}</span>
      </span>
        </div>
        <div class="panel-body">
            <p><span style="font-family:微软雅黑;">此页面用于添加你当天所销售的产品信息，以便兑换奖励。</span></p>
        </div>
        <!-- Modal -->


        <!--Model ALL-->
        <!-- Modal -->
        <div class="modal fade" id="addModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
            <div class="modal-dialog" role="document">
                <div class="modal-content">
                    <div class="modal-header">
                        <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span
                                aria-hidden="true">&times;</span></button>
                        <h4 class="modal-title" id="addModalLabel">录入今日销售产品</h4>
                    </div>
                    <div class="modal-body" style="font-family:微软雅黑;">
                        <form action="<%= basePath %>/save" method="post">
                            <div class="form-group">
                                <label for="exampleInputEmail1">员工工号</label>
                                <input class="form-control" id="exampleInputEmail1" name="userId"
                                       value="${userInfo.userLoginName}" readonly>
                            </div>
                            <div class="form-group">
                                <label for="exampleInputEmail2">员工姓名</label>
                                <input class="form-control" id="exampleInputEmail2" name="userName"
                                       value="${userInfo.userRealname}" readonly>
                            </div>
                            <div class="form-group">
                                <label for="bonusSelectType">产品类型</label>
                                <select class="form-control" id="bonusSelectType" name="productType">
                                    <option value="流量">流量</option>
                                    <option value="语音">语音</option>
                                </select>
                            </div>
                            <div class="form-group">
                                <label for="bonusSelectProduct">产品</label>
                                <select class="form-control" id="bonusSelectProduct" name="productId">
                                    <option value="流量卡1">流量卡1</option>
                                    <option value="流量卡2">流量卡2</option>
                                </select>
                            </div>
                            <div class="form-group">
                                <label for="bonusSelectNumber">产品数量</label>
                                <select class="form-control" id="bonusSelectNumber" name="productNumber">
                                    <option>1</option>
                                    <option>2</option>
                                    <option>3</option>
                                    <option>4</option>
                                    <option>5</option>
                                </select>
                            </div>
                            <div class="form-group">
                                <label for="customerName">客户姓名</label>
                                <input class="form-control" id="customerName" name="customerName">
                            </div>
                            <div class="form-group">
                                <label for="customerTele">客户电话</label>
                                <input class="form-control" id="customerTele" name="customerTele">
                            </div>
                            <div class="form-group" align="right">
                                <button type="submit" id="addProduct" name="addProduct" class="btn btn-primary">添加
                                </button>
                                &nbsp;&nbsp;&nbsp;
                            </div>
                        </form>

                    </div>

                </div>
            </div>
        </div>
        <!-- Table -->
        <table class="table" style="font-family:微软雅黑;table-layout:fixed;">
            <tr>

                <th>类别</th>
                <th>产品</th>
                <th>数量</th>
                <th>奖励金额(元)</th>
                <th>操作时间</th>
                <th>操作</th>

            </tr>
            <%int i = 0;%>
            <c:forEach items="${hbbtSalesHisModelList}" var="list">
                <tr>
                    <td>${list.prod_type}</td>
                    <td>${list.prod_name}</td>
                    <td>${list.sale_nums}</td>
                    <td>${list.prod_reward_now}</td>
                    <td>${list.create_date}</td>
                    <th>
                        <button type="button" class="btn btn-default btn-xs glyphicon glyphicon-trash"
                                onclick="javascript:if(confirm('确定要删除此信息吗？')){window.location.href='<%= basePath %>/delete?id=${list.hbbt_sales_his_model_id}&method=delete'}else{return false;}">

                        </button>
                    </th>
                </tr>
            </c:forEach>

        </table>

        <%--<div class="panel-body">--%>
        <%--<p align="center"><span style="font-family:微软雅黑;">日期:2017-05-06 &nbsp;&nbsp; 今日销售:XXX &nbsp;&nbsp; 奖金:XXXX</span> </p>--%>
        <%--</div>--%>
    </div>


    <hr>
    <footer>
        <p align="center">&copy; <span style="font-family:微软雅黑; ">copyright &nbsp;中国电信股份有限公司河北分公司企业信息化部 2016</span></p>
    </footer>
</div>
<!-- /container -->


<!-- Bootstrap core JavaScript
================================================== -->
<!-- Placed at the end of the document so the pages load faster -->

<script src="static/js/jquery.min.js"></script>
<script src="static/css/dist/js/bootstrap.min.js"></script>
<script src="static/css/assets/js/docs.min.js"></script>
<!-- IE10 viewport hack for Surface/desktop Windows 8 bug -->
<script src="static/css/assets/js/ie10-viewport-bug-workaround.js"></script>
<!--
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
-->

<script type="text/javascript">

    window.onload = init;//传入函数地址
    function init() {
        var provinceEle = document.getElementById('bonusSelectType');
        provinceEle.onchange = function () {
            var cityEle = document.getElementById('bonusSelectProduct');
            cityEle.innerHTML = ""; // 每次进来先清空城市列表
            var provinceValue = this.value;


            switch (provinceValue) {
                case "流量":
                    var cities = ['流量卡1', '流量卡2']
                    break;
                case "语音":
                    var cities = ['语音包1', '语音包2']
                    break;

            }
            for (var i = 0; i < cities.length; i++) {
                var option = document.createElement('option'); //先创建option
                var textNode = document.createTextNode(cities[i]); //再把城市名作为子节点填入，也可用innerHTML
                option.appendChild(textNode);
                cityEle.appendChild(option);
            }
        }
    }


</script>


</body>
</html>
